/*
 * Created on 25.07.2004
 *
 * Copyright (c) 2004 The GnutellaSim Project
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */
package util;

import java.util.Random;

/**
 * @author bennobaumgartner
 *
 * TODO Comment
 */
public class LinearNumberGenerator implements NumberGenerator {

	public LinearNumberGenerator(int min, int max) {
		this.min = min;
		this.max = max;
		rng = new Random();
	}

	/* (non-Javadoc)
	 * @see util.NumberGenerator#getNumber()
	 */
	public int getNumber() {

		return rng.nextInt(max-min+1)+min;
	}
	
	private int min;
	private int max;
	private Random rng;

}
